package cn.seven;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;

import com.jfinal.kit.PropKit;

import cn.seven._conf._jfinal.DBConfig;

/**
 * create by 张天笑, 2017/11/1 22:18
 */
@ComponentScan("cn.seven")
@ServletComponentScan
@SpringBootApplication
public class App extends SpringBootServletInitializer {
	public static void main(String... args) throws Exception {
		PropKit.use("me.properties");
		DBConfig.startArp();
		SpringApplication.run(App.class, args);
	}

	@Override
	protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
		PropKit.use("me.properties");
		try {
			DBConfig.startArp();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return application.sources(App.class);
	}
}
